﻿<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="Bookmark" href="/favicon.ico">
    <link rel="Shortcut Icon" href="/favicon.ico"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="/lib/html5shiv.js"></script>
    <script type="text/javascript" src="/lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="/h-ui.admin/css/H-ui.admin.uscss"/>
    <link rel="stylesheet" type="text/css" href="/lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="/h-ui.admin/css/style.css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="/lib/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <script type="text/javascript" src="../../js/commonCss.js"></script>
    <script type="text/javascript" src="../../js/commonJs.js"></script>
    <![endif]-->
    <!--/meta 作为公共模版分离出去-->

    <title>办理</title>
</head>
<body>
<div class="page-container">
    <form class="form form-horizontal" id="form-article-add">
        <div id="tab-system" class="HuiTab">
            <div id="top_1">
            </div>
        </div>
        <div class="row cl">

        </div>
    </form>
</div>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">

    (function ($) {
        $.getUrlParam = function (name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            //if (r != null) return unescape(r[2]);
            if( r != null ) return decodeURI( r[2] );  //解决中文乱码
            return null;
        }
    })(jQuery);


    $(function () {
        var str = "";
        var str1 = "";
        var str2 = "";
        var processInstanceId = $.getUrlParam('processInstanceId');
        //alert(processInstanceId)
        var formKey = $.getUrlParam('formKey');

        var taskId = $.getUrlParam('taskId');
        var taskName = $.getUrlParam('taskName');
        //alert(taskId)
        $.ajax({
            type: 'POST',
            contentType: "application/json;charset=UTF-8",
            url: '/history/historyTaskList',
            dataType: 'json',
            data: '{"processInstanceId":"' + processInstanceId + '"}',
            success: function (data) {
                var obj = eval(data);
                //alert(JSON.stringify(obj))

                str1 = "<div class=\"tabBar cl\" >";
                for (var i = 0; i < obj.length; i++) {
                    if (str == "") {
                        str = '<span>' + obj[i].name + '</span>';
                    } else {
                        str = str + '<span>' + obj[i].name + '</span>';
                    }
                    if (str2 == "") {

                        str2 = "<div height=\"700px\" class=\"tabCon\"><iframe width=\"100%\" height=\"700px\" src=\"/easyui/act/process/form.html?formKey=" + obj[i].formKey + "&taskId=" + obj[i].id + "\"></iframe></div>";
                    } else {

                        str2 = str2 + "<div height=\"700px\" class=\"tabCon\"><iframe width=\"100%\" height=\"700px\" src=\"/easyui/act/process/form.html?formKey=" + obj[i].formKey + "&taskId=" + obj[i].id + "\"></iframe></div>";
                    }
                }
                str = str + '<span><font color="red">当前环节:</font>'+taskName+'</span>';
                str2 = str2 + "<div height=\"700px\" class=\"tabCon\"><iframe id='apple2' width=\"100%\" height=\"700px\" src=\"/easyui/act/process/form.html?taskId=" + taskId + "&formKey=" +formKey+"\"></iframe></div>";


                str1 = str1 + str + "</div>" + str2;
                console.log(str1);
                $("#top_1").html(str1);
                $('.skin-minimal input').iCheck({
                    checkboxClass: 'icheckbox-blue',
                    radioClass: 'iradio-blue',
                    increaseArea: '20%'
                });
                $("#tab-system").Huitab({
                    index: obj.length
                });
            },
            error: function (data) {
                console.log(data.msg);
            }
        });
    });

    function apple1(){
        var myIframe = document.getElementById("apple2").contentWindow.appletest();

    }


</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
